<%@ page language="java" import="java.util.*" import="com.quarter.action.*" import="com.quarter.vo.User" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>实习实训管理系统</title>
<script language="JavaScript">
var company = new Array();
var position = new Array();
</script>
<%
 out.print("<script>");
 //对每个省的数组添加地区数据
 out.print("company[0] = new Array(new Option('',''), new Option('..','goUp'), new Option('程序员','330100'), new Option('助理','330200'));");
 out.print("company[1] = new Array(new Option('',''), new Option('..','goUp'), new Option('程序员','330100'), new Option('助理','330200'));");
 
 out.print("</script>");

 out.print("<script>");
 //对每个省每个地区的数组添加县市数据
 out.print("position[330100] = new Array(new Option('',''), new Option('..','goUp'),new Option('未申请','unapplying'), new Option('申请','applying'), new Option('面试','interview'), new Option('实习','internship'));");
 out.print("position[330200] = new Array(new Option('',''), new Option('..','goUp'), new Option('未申请','unapplying'), new Option('面试','interview'), new Option('实习','internship'));");
 out.print("</script>");
%>
<script>

</script>
<script>
function com_chg()
{
 with (document.all){
  if(hcom.value) {
   var ln = hpos.options.length;
   while(ln--) {
    hpos.options[ln] = null;
   }
   ln = hstat.options.length;
   while(ln--) {
    hstat.options[ln] = null;
   }
   for(var i=0; i<company[hcom.value].length; i++){
    hpos.add(company[hcom.value][i]);
   }
  }
 }
 if(document.form1.hcom.value != "")
 {
  d2.style.display="";
  d1.style.display="none";
  d3.style.display="none";
 }
 else {
 }
}

function pos_chg()
{
 if(document.form1.hpos.value == "goUp")
 {
  document.form1.hcom.value = "";
  d1.style.display="";
  d2.style.display="none";
  d3.style.display="none";
 } else if (document.form1.hpos.value != "")
 {
  d1.style.display="none";
  d2.style.display="none";
  d3.style.display="";
 }
 with (document.all){
  if(hpos.value) {
   var ln = hstat.options.length;
   while(ln--) {
    hstat.options[ln] = null;
   }
   for(var i=0; i<position[hpos.value].length; i++){
    hstat.add(position[hpos.value][i]);
   }
  }
 }
}

function state_chg() {
 if (document.form1.hstat.value == "goUp")
 {
  d1.style.display="none";
  d2.style.display="";
  d3.style.display="none";
 }
}

</script>
<link href="css/css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="zhong">
  <div class="banner"><img src="images/img_2.gif" /></div>
   <div class="menu">
    <div class="menusel" style="width:95px;">
      <h2><a href="login.jsp">首页</a></h2>
    </div>
    
    
    <div id="menu1" class="menusel">
      <h2><a href="adminInfo.jsp">个人中心</a></h2>
      <div class="position">
        </div>
      </div>
      <div id="menu2" class="menusel">
      <h2><a href="upload.jsp">文件上传</a></h2>
      
      <div class="position">
        </div>
      </div>
      
      <div id="menu4" class="menusel">
      <h2><a href="comInfo.jsp">企业信息发布与修改</a></h2>
      <div class="position">
        </div>
      </div>
      <div id="menu5" class="menusel">
      <h2><a href="match.jsp">学生企业实习分配</a></h2>
      <div class="position">
        </div>
      </div>
      <div id="menu6" class="menusel">
      <h2><a href="admin.jsp">返回</a></h2>
      <div class="position">
        
        </ul>--> 
      </div>
    </div>
  </div>
  
  <div class="meun_2">欢迎你，<%= session.getAttribute("uid") %>。 </div>

  <div class="main">
    
    <div class="right">
	
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p><strong>进行实习分配：</strong></p>
<s:form name="form1" method="post" action="match" namespace="/"> 
     学生学号：<select size="1" style="width:100px" name="match.sid">
        <option seleted></option>
        <%
        	StudentListAction ListS = new StudentListAction();
        	ArrayList list1 = new ArrayList();
        	list1 = ListS.getList();          	   	
        if(list1!=null)
        	for(int i=0;i<list1.size();i++)
        	{  
        		User user = new User();
        		user = (User)list1.get(i);     		
        %>
        	 <option value="<%=user.getUid() %>"><%=user.getUid() %></option>
        	<%
        	}
            %>
        </select>
        </br>
  <table > 
    <tr> </tr> 
    <tr> 
      <td style="display:inline " id="d1" > 公司
        <select  id="hcom" onChange="javascipt:com_chg();" name="match.cid"> 
          <option value=""></option> 
<%
 CompanyListAction ListC = new CompanyListAction();
        	ArrayList list2 = new ArrayList();
        	list2 = ListC.getList();          	   	
        if(list2!=null)
        	for(int i=0;i<list2.size();i++)
        	{  
        		String com ;
        		com = (String)list2.get(i);     		
        %>
        	 <option value="<%=i %>"><%=com %></option>
        	<%
        	}
%> 
        </select> </td> 
      <td style="display:none " id="d2"> 岗位
        <select  id="hpos" onChange="javascipt:pos_chg();" name="match.jid"> 
          <option value=""></option> 
        </select> </td> 
      <td style="display:none " id="d3" > 状态
        <select  id="hstat" onChange="javascipt:state_chg();" name="match.status"> 
          <option value=""></option> 
        </select> </td> 
    </tr>
  </table> 
  <p><s:submit label="match"></s:submit></p>
</s:form></br>
    </div>
    <div class="clear"></div>
</div>
<script src="js/meun.js" type="text/javascript"></script>
<div style="display:none"><script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script></div></body>
</html>
